package com.newbee.config;

import com.google.common.collect.ImmutableMap;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TraceConfig {

    @Bean("warnThresholdsMap")
    public ImmutableMap<String, Long> warnThresholdsMap() {
        return ImmutableMap.<String, Long>builder()
                .put("com.newbee.controller.DemoController.demoTest1", 200L)
                .put("com.newbee.service.DemoServiceA.funcA", 150L)
                .put("com.newbee.service.DemoServiceC.funcC", 30L)
                .put("com.newbee.service.DemoServiceD.funcD", 20L)
                .build();
    }

    @Bean("traceContextShareConfig")
    public ImmutableMap<String, Boolean> TraceContextShareConfig() {
        return ImmutableMap.<String, Boolean>builder()
                .put("com.newbee.controller.DemoController.demoTest1", true)
                .put("com.newbee.controller.DemoController.demoTest2", true)
                .build();
    }

    @Bean("traceEnable")
    public boolean traceEnable() {
        return true;
    }
}
